from django.db import models

class Users(models.Model):
    """用户模型类"""
    mobile = models.CharField(max_length=11, verbose_name='手机号')
    password = models.CharField(max_length=11, verbose_name='密码')
    user_name = models.CharField(max_length=255, verbose_name='用户名', default="默认用户名")
    txt = models.CharField(max_length=255, verbose_name='备注', default="无")
    image_path = models.CharField(max_length=255, verbose_name='头像url',null=True)
    vote_num = models.IntegerField(default=0,  verbose_name='获票数量')
    is_show = models.IntegerField(default=0, verbose_name='是否首页展示')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间", null=True)
    class Meta:
        db_table = 'tb_user'
        verbose_name = '用户数据表'
        verbose_name_plural = verbose_name

class Site(models.Model):
    """用户ip地址类"""
    uuid = models.CharField(max_length=11, verbose_name='手机号')
    uip = models.CharField(max_length=11, verbose_name='登录的ip')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间", null=True)
    class Meta:
        db_table = 'tb_site'
        verbose_name = '用户状态表'
        verbose_name_plural = verbose_name